<template>
  <div
    :class="
      flag
        ? 'welcome-login'
        : 'welcome-login animate__animated animate__bounceOutRight'
    "
  >
    <button @click="login">登录</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

const flag = ref(true);
const login = () => {
  flag.value = false;

  setTimeout(() => {
    router.push("/login");
  }, 500);
};
</script>

<style scoped lang="scss">
.welcome-login {
  width: 100vw;
  height: 100vh;
  background: url("https://img1.baidu.com/it/u=2466190668,3760574831&fm=253&fmt=auto&app=138&f=PNG?w=500&h=750")
    no-repeat center;
  background-size: cover;
}
button {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background-color: #fff;
  color: #000;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  &:hover {
    background-color: #000;
    color: #fff;
  }
}
</style>